package main

import "fmt"

/**
接口
 */
func main() {

	var phone Phone

	phone = new(NokiaPhone)
	phone.call()

	phone = new(IPhone)
	phone.call()

}

/** 定义接口 **/
type Phone interface {
	call()
}

type NokiaPhone struct {
}

func (nokia NokiaPhone) call() {
	fmt.Println("I am Nokia,I can call you")
}

type IPhone struct {
}

func (iPhone IPhone) call() {
	fmt.Println("I am iPhone,I can call you")
}
